package com.design.mall;

import java.util.Map;
import java.util.Scanner;

/**
 * @author by liuxin
 * @version 0.1
 */
public class Client2 {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.print("请输入打折方式（1/2/3）：");
        int in = scanner.nextInt();

        CashContext2 cashContext2 = new CashContext2(in);
        System.out.print("请输入单价：");
        double price = scanner.nextDouble();
        System.out.print("请输入数量：");
        double num = scanner.nextDouble();
        Map<String, Object> cash = cashContext2.pay(price * num);
        System.out.println("单价：" + price + "，数量：" + num + "，类型：" + cash.get("message") + "，合计：" + cash.get("money"));
        scanner.close();
    }
}
